#!/bin/sh
######################
#
# It's nesseray that to run SBO before this module 
#
######################
FOLDER=caculate_return
IMPORT=whole.SBO

mv *.array.top50 ${FOLDER}
mv ${IMPORT}/*.${IMPORT} ${FOLDER}
cd ${FOLDER}

# generate caculate_return.sh

echo "#!/bin/sh
IMPORT=whole.SBO
EXPORT=sbo.whole.return
" > ${FOLDER}.sh

cat all.array.top50 >> ${FOLDER}.sh

filenames=`wc -l all.array.top50 | awk '{print $1}'`
#####
echo "i=0
while [ \$i -le $((filenames-1)) ]" >> ${FOLDER}.sh
#####
cat ${FOLDER}.tample.1.sh >> ${FOLDER}.sh

chmod a+x *.sh
./${FOLDER}.sh

